.order-detail-layout {
  /* min-height: 100vh; */
  background-color: #f5f5f5;
  overflow-x: hidden;
}

.order-detail-header {
  background: white;
  padding: 16px 24px;
  border-bottom: 1px solid #e8e8e8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.back-button {
  color: #666;
  border: none;
  box-shadow: none;
}

.back-button:hover {
  color: #1890ff;
  background-color: #f0f0f0;
}

.page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #262626;
}

.main-container {
  padding: 16px;
  max-width: 1600px;
  margin: 0 auto;
  max-height: calc(100vh - var(--header-height) - 48px);
  overflow: hidden;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  align-items: start;
}

.products-section {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  min-height: calc(100vh - 140px);
  max-height: 840px;
  height: 100%;
  overflow-y: auto;
}

.search-container {
  margin-bottom: 20px;
}

.search-input {
  max-width: 500px;
}

.category-tabs {
  margin-bottom: 20px;
}

.category-tabs .ant-tabs-tab {
  padding: 10px 16px;
  font-weight: 500;
  border-radius: 6px;
  margin-right: 8px;
}

.category-tabs .ant-tabs-tab-active {
  color: #1890ff;
  background-color: #f0f6ff;
}

.category-tabs .ant-tabs-tab:hover {
  color: #1890ff;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  /* min-height: 400px; */
  padding-bottom: 20px;
}

.product-card {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  height: fit-content;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: #1890ff;
}

.product-image {
  width: 100%;
  height: 140px;
  background-color: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-image-placeholder {
  color: #bfbfbf;
  font-size: 28px;
}

.product-content {
  padding: 14px;
  text-align: left;
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 8px;
}

.product-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #262626;
  line-height: 1.4;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  color: #ff4d4f;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.product-description {
  color: #8c8c8c;
  font-size: 11px;
  line-height: 1.3;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 28px;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.product-stock {
  color: #8c8c8c;
  font-size: 11px;
}

.cart-section {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  height: fit-content;
  max-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
}

.cart-header {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e8e8e8;
  flex-shrink: 0;
}

.cart-header h4 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.cart-content {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 16px;
  max-height: 50vh;
  scrollbar-width: thin;
  scrollbar-color: #d9d9d9 transparent;
}

.cart-content::-webkit-scrollbar {
  width: 6px;
}

.cart-content::-webkit-scrollbar-track {
  background: transparent;
}

.cart-content::-webkit-scrollbar-thumb {
  background-color: #d9d9d9;
  border-radius: 3px;
}

.cart-content::-webkit-scrollbar-thumb:hover {
  background-color: #bfbfbf;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background-color: #fafafa;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  transition: all 0.2s ease;
}

.cart-item:hover {
  background-color: #f0f6ff;
  border-color: #d6e4ff;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.cart-item-name {
  font-weight: 500;
  color: #262626;
  margin-bottom: 4px;
  font-size: 13px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-item-variant {
  font-size: 11px;
  color: #8c8c8c;
  margin-bottom: 4px;
}

.cart-item-price {
  color: #ff4d4f;
  font-weight: 600;
  font-size: 13px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cart-item-controls .ant-btn {
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-quantity {
  min-width: 20px;
  text-align: center;
  font-weight: 500;
  font-size: 13px;
}

.cart-footer {
  padding-top: 16px;
  border-top: 1px solid #e8e8e8;
  flex-shrink: 0;
}

.cart-total {
  margin-bottom: 16px;
  text-align: right;
  font-size: 16px;
  padding: 8px 0;
}

.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.empty-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.variant-modal-content {
  padding: 16px 0;
}

.product-info {
  margin-bottom: 16px;
}

.variant-selection {
  margin: 16px 0;
}

.variant-selection .ant-typography {
  margin-bottom: 12px;
}

.variant-selection .ant-radio-group {
  width: 100%;
}

.variant-selection .ant-radio-wrapper {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.variant-selection .ant-radio-wrapper:hover {
  border-color: #1890ff;
  background-color: #f0f6ff;
}

.variant-selection .ant-radio-wrapper-checked {
  border-color: #1890ff;
  background-color: #f0f6ff;
}

.attribute-group {
  margin-bottom: 16px;
}

.attribute-group .ant-typography {
  margin-bottom: 8px;
}

.quantity-selection {
  display: flex;
  align-items: center;
  margin: 16px 0;
  gap: 12px;
}

.variant-total {
  margin-top: 16px;
  text-align: right;
  padding-top: 16px;
  border-top: 1px solid #e8e8e8;
  font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 1400px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1200px) {
  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cart-section {
    position: static;
    max-height: none;
  }

  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .main-container {
    padding: 12px;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .order-detail-header {
    padding: 12px 16px;
  }

  .page-title {
    font-size: 18px;
  }

  .products-section,
  .cart-section {
    padding: 16px;
  }

  .content-wrapper {
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .product-content {
    padding: 10px;
  }

  .product-name {
    font-size: 13px;
  }

  .product-price {
    font-size: 14px;
  }
}

/* 打印选项样式 */
.print-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid #f0f0f0;
  margin-top: 12px;
  transition: all 0.2s ease;
}

.print-option:hover {
  background-color: #f9f9f9;
  border-radius: 6px;
  padding: 12px 8px;
  margin: 12px -8px 0;
}

.print-option .anticon {
  color: #1890ff;
  font-size: 16px;
}

.print-option .ant-typography {
  color: #262626;
  font-weight: 500;
  margin: 0;
}

.print-option .ant-switch {
  background-color: #1890ff;
}

.print-option .ant-switch-checked {
  background-color: #52c41a;
}
